#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
float pice_(float weight,float x,float y)
{
    float pice = 0.0;
    int flag = 0;
    if (weight <= 1)
    {
        pice = 10.0;
    }
    else
    {
        weight = weight - 1;
        flag = weight;
        if ((weight - flag) > 0)
        {
            pice = y + (flag + 1) * x;
        }
        else
        {
            pice = y + flag * x;
        }
    }
    return pice;
}
int main(void)
{
    /*********Begin*********/

    int area = 0;
    float weight = 0.0;
    float pice = 0.0;
    scanf("%d,%f", &area, &weight);
    switch (area)
    {
    case 0:
        pice=pice_(weight,3.0,10);
        break;
    case 1:
        pice = pice_(weight, 4.0,10.0);
        break;
    case 2:
        pice = pice_(weight, 5.0,15.0);
        break;
    case 3:
        pice = pice_(weight, 6.5,15.0);
        break;
    case 4:
        pice = pice_(weight, 10.0,15.0);
        break;
    default:
        printf("Error in Area\n");
        printf("Price:  0.00");
        break;
    }
    printf("Pice: %.2f", pice);
    /*********End**********/
    return 0;
}
